<template>
  <div class="main">
    <router-view />
    <van-tabbar v-model="active" route v-if="['Home','Category', 'Personal'].includes($route.name)">
      <van-tabbar-item to="/" icon="home-o">首页</van-tabbar-item>
      <van-tabbar-item to="/category/index" icon="search">分类</van-tabbar-item>
      <van-tabbar-item to="/personal/index" icon="friends-o">我的</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
// @ is an alias to /src
import { Tabbar, TabbarItem } from 'vant'
export default {
  name: 'Home',
  components: {
    [Tabbar.name]: Tabbar,
    [TabbarItem.name]: TabbarItem
  },
  data () {
    return {
      active: 'home'
    }
  }
}
</script>
<style lang="scss" scoped>
</style>
